export const CACHE_PATH_AND_DISK_STORE = 'CACHE_PATH_AND_DISK_STORE'
// export const providerOptions: LabelValue[] = [
//   {
//     label: 'DNS 独立版',
//     value: 1
//   },
//   {
//     label: 'Cloudflare',
//     value: 2
//   }
// ]

export enum NODE_STATUS {
  NORMAL = 1,
  ABNORMAL,
  STOP,
  OFFLINE,
  INIT,
}

export const CdnNodeStatusOptions = [
  {
    label: '运行中',
    value: NODE_STATUS.NORMAL,
  },
  {
    label: '异常',
    value: NODE_STATUS.ABNORMAL,
  },
  {
    label: '停止',
    value: NODE_STATUS.STOP,
  },
  {
    label: '离线',
    value: NODE_STATUS.OFFLINE,
  },
  {
    label: '初始化',
    value: NODE_STATUS.INIT,
  },
]

export enum NODE_OPERATIONS {
  START = 'start',
  RELOAD = 'reload',
  STOP = 'stop',
  SYNC = 'sync',
  RESTART = 'restart',
  UNINSTALL = 'uninstall',
  PURGE = 'purge',
}
export const diskOptions: LabelValue[] = [
  { label: 'MB', value: 1, max: 966367641600 },
  { label: 'GB', value: 2, max: 943718400 },
  { label: 'TB', value: 3, max: 921600 },
  { label: 'PB', value: 4, max: 900 },
]

export const wafStrategyOptions = [
  { label: '阻止', value: 1 },
  // { label: '跳过', value: 2 },
  { label: '观察', value: 3 },
]

export const wafCustomOptions = [
  { label: '阻止', value: 1 },
  // { label: '跳过', value: 2 },
  { label: '观察', value: 3 },
  { label: 'JS 质询', value: 4 },
  { label: '交互式质询', value: 5 },
]

export enum A_RESPONSE_TYPE {
  DEFAULT = 1,
  CUSTOM_HTML,
  CUSTOM_TEXT,
  CUSTOM_JSON,
  CUSTOM_XML,
}

export const RESPONSE_TYPE_LIST = [
  {
    value: A_RESPONSE_TYPE.DEFAULT,
    label: 'WAF 阻止错误页',
  },
  {
    value: A_RESPONSE_TYPE.CUSTOM_HTML,
    label: '自定义 HTML',
  },
  {
    value: A_RESPONSE_TYPE.CUSTOM_TEXT,
    label: '自定义文本',
  },
  {
    value: A_RESPONSE_TYPE.CUSTOM_JSON,
    label: '自定义 JSON',
  },
  {
    value: A_RESPONSE_TYPE.CUSTOM_XML,
    label: '自定义 XML',
  },
]
// export enum LICENSE_BRAND {
//   LETS_ENCRYPT = 1,
//   ZERO_SSL,
// }
// export enum LICENSE_ALGORITHM {
//   EC256 = 1,
//   EC384,
//   RSA2048,
//   RSA3072,
//   RSA4096,
// }

export const LicenseBrandOptions = [
  {
    label: 'Let\'s Encrypt',
    value: 'Let\'s Encrypt',
  },
  {
    label: 'ZeroSSL',
    value: 'ZeroSSL',
  },
]
export const LicenseAlgorithmOptions = [
  {
    label: 'EC256',
    value: 'EC256',
  },
  {
    label: 'EC384',
    value: 'EC384',
  },
  {
    label: 'RSA2048',
    value: 'RSA2048',
  },
  {
    label: 'RSA3072',
    value: 'RSA3072',
  },
  {
    label: 'RSA4096',
    value: 'RSA4096',
  },
]

export enum LICENSE_SOURCE {
  MANUAL = 1,
  SYSTEM,
}
export const LicenseSourceOptions = [
  {
    label: '手动上传',
    value: LICENSE_SOURCE.MANUAL,
  },
  {
    label: '免费证书',
    value: LICENSE_SOURCE.SYSTEM,
  },
]

export enum A_EXECUTION_PRIORITY {
  LAST = 0,
  FIRST = 1,
  CUSTOM,
}
// 执行优先级
export const priorityOptions = [
  {
    value: A_EXECUTION_PRIORITY.FIRST,
    label: '第一个',
  },
  {
    value: A_EXECUTION_PRIORITY.LAST,
    label: '最后一个',
  },
  {
    value: A_EXECUTION_PRIORITY.CUSTOM,
    label: '自定义',
  },
]

// 执行策略
export enum A_EXECUTION_TYPE {
  PREVENT = 1,
  SKIP,
  OBSERVE,
  JS,
  INTERACTIVE,
}
export const executionOptions: LabelValue[] = [
  { label: '阻止', value: A_EXECUTION_TYPE.PREVENT },
  { label: '观察', value: A_EXECUTION_TYPE.OBSERVE },
]

export const customOptions: LabelValue[] = [
  { label: '阻止', value: A_EXECUTION_TYPE.PREVENT },
  { label: '跳过', value: A_EXECUTION_TYPE.SKIP },
  { label: '观察', value: A_EXECUTION_TYPE.OBSERVE },
  { label: 'JS 质询', value: A_EXECUTION_TYPE.JS },
  { label: '交互式质询', value: A_EXECUTION_TYPE.INTERACTIVE },
]

// 缓存时间
export enum A_CACHE_TIME {
  DAY = 'd',
  HOUR = 'h',
  MINUTE = 'm',
  SECOND = 's',
}
export const cacheTimeOptions: LabelValue[] = [
  { label: '天', value: A_CACHE_TIME.DAY },
  { label: '小时', value: A_CACHE_TIME.HOUR },
  { label: '分钟', value: A_CACHE_TIME.MINUTE },
  { label: '秒', value: A_CACHE_TIME.SECOND },
]
export enum A_SKIP_MODULE_TYPE {
  CUSTOM_RULE = 1,
  RATE_LIMIT,
}
// 跳过模块
export const skipModuleOptions = [
  {
    value: A_SKIP_MODULE_TYPE.CUSTOM_RULE,
    label: '自定义规则',
  },
  {
    value: A_SKIP_MODULE_TYPE.RATE_LIMIT,
    label: '速率限制',
  },
]

export const indexSizeOptions: LabelValue[] = [
  { label: 'MB', value: 1, max: 131072 },
  { label: 'GB', value: 2, max: 128 },
]

export const providerTypeOptions: LabelValue[] = [
  { label: '自运营', value: -1 },
  { label: '-', value: 0 },
  { label: 'Cloudflare', value: 1 },
]

export const certListOptions: LabelValue[] = [
  { label: 'Unknown', value: 0 },
  { label: '已更新', value: 1 },
  { label: '已失败', value: 2 },
  { label: '更新中', value: 3 },
]

export const certListStatusOptions: LabelValue[] = [
  { label: 'Unknown', value: 0 },
  { label: '已成功', value: 1 },
  { label: '已失败', value: 2 },
  { label: '更新中', value: 3 },
]

export const certRecordStatusOptions: LabelValue[] = [
  { label: 'Unknown', value: 0 },
  { label: '已成功', value: 1 },
  { label: '已失败', value: 2 },
  { label: '申请中', value: 3 },
]

export const certManualApplyOptions: LabelValue[] = [
  { label: '系统', value: 1 },
  { label: '管理员', value: 2 },
  { label: '用户', value: 3 },
]

export enum SITE_RESOLVE_STATUS {
  PROCESSING = 1,
  SUCCESS = 2,
  FAILED = 3,
  PAUSED = 4,
}

export const siteResolveStatusOptions = [
  {
    label: '处理中',
    value: SITE_RESOLVE_STATUS.PROCESSING,
  },
  {
    label: '成功',
    value: SITE_RESOLVE_STATUS.SUCCESS,
  },
  {
    label: '失败',
    value: SITE_RESOLVE_STATUS.FAILED,
  },
  {
    label: '成功', // 暂停解析
    value: SITE_RESOLVE_STATUS.PAUSED,
  },
]

export enum STORAGE_UNIT {
  STORAGE_UNIT_UNSPECIFIED = 0,
  STORAGE_UNIT_KB = 1,
  STORAGE_UNIT_MB = 2,
  STORAGE_UNIT_GB = 3,
  STORAGE_UNIT_TB = 4,
  STORAGE_UNIT_PB = 5,
}

// V1.1 磁盘-分配容量
export const capacityOptions: LabelValue[] = [
  { label: 'GB', value: STORAGE_UNIT.STORAGE_UNIT_GB, max: 999 },
  { label: 'TB', value: STORAGE_UNIT.STORAGE_UNIT_TB, max: 999 },
]

// V1.1 磁盘-单文件最大大小
export const diskFileSizeOptions: LabelValue[] = [
  { label: 'MB', value: STORAGE_UNIT.STORAGE_UNIT_MB, max: 1024 },
  { label: 'GB', value: STORAGE_UNIT.STORAGE_UNIT_GB, max: 999 },
]

// V1.1  内存-最大容量
export const MaxSizeOptions: LabelValue[] = [
  { label: 'MB', value: STORAGE_UNIT.STORAGE_UNIT_MB, max: 1024 },
  { label: 'GB', value: STORAGE_UNIT.STORAGE_UNIT_GB, max: 999 },
]

// V1.1 内存-单文件最大大小
export const memoryFileSizeOptions: LabelValue[] = [
  { label: 'KB', value: STORAGE_UNIT.STORAGE_UNIT_KB, max: 1024 },
  { label: 'MB', value: STORAGE_UNIT.STORAGE_UNIT_MB, max: 999 },
]
